// 定义重力系统影响下的物体运动（质心变化）

export default MovingObj

// 障碍物移动速度（水平方向）
// 50hz刷新率 每次刷新移动2px
function MovingObj(x, y) {
    this.x = x;
    this.y = y;
    this.speed = 0;
    this.acceleratedSpeed = 200;

    this.update = function () {
        this.y = this.y + this.speed / 50;
        this.speed += this.acceleratedSpeed / 50;
    }

    this.changeSpeed = function () {
        this.speed = -100;
    }

}